/// 获取Vec的值和改变它
pub fn test() {
    let mut c = vec![5, 4, 3, 2, 1];
    c[0] = 1;
    c[1] = 2;
    println!("{:?}", c);

    let mut d: Vec<i32> = Vec::new();
    d.push(1);
    d.push(2);
    d.push(3);
    d.pop();
    println!("{:?}", d);

    let mut e: Vec<i32> = Vec::with_capacity(10);
    println!("Length: {}, Capacity: {}", e.len(), e.capacity()); // 长度表示当前值多少；cap表示变量的容量
    for i in 0..10 {
        e.push(i);
    }
    println!("Length: {}, Capacity: {}", e.len(), e.capacity());
    e.push(11);
    println!("Length: {}, Capacity: {}", e.len(), e.capacity()); // 自动扩容
}
